# Contributor: Bart Ribbers <bribbers@disroot.org>
# Maintainer: team/kde <bribbers@disroot.org>

# The group tag is just to easily find this APKBUILD by some scripts for automation
# group=kde-frameworks
pkgname=modemmanager-qt5
pkgver=5.113.0
pkgrel=0
pkgdesc="Qt wrapper for ModemManager DBus API"
# armhf blocked by extra-cmake-modules
arch="all !armhf"
url="https://community.kde.org/Frameworks"
license="LGPL-2.1-only OR LGPL-3.0-only"
depends_dev="
	modemmanager-dev
	qt5-qtbase-dev
	"
makedepends="$depends_dev
	doxygen
	extra-cmake-modules
	graphviz-dev
	qt5-qttools-dev
	samurai
	"
subpackages="$pkgname-dev $pkgname-doc"
checkdepends="dbus"
_repo_url="https://invent.kde.org/frameworks/modemmanager-qt.git"
source="https://download.kde.org/stable/frameworks/${pkgver%.*}/modemmanager-qt-$pkgver.tar.xz"
builddir="$srcdir/modemmanager-qt-$pkgver"

replaces="modemmanager-qt<=5.110.0-r0"

build() {
	cmake -B build -G Ninja \
		-DCMAKE_BUILD_TYPE=RelWithDebInfo \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib \
		-DBUILD_QCH=ON
	cmake --build build
}

check() {
	dbus-run-session -- ctest --test-dir build --output-on-failure
}

package() {
	DESTDIR="$pkgdir" cmake --install build
}

sha512sums="
c146d13b05ba985f735c3e5952d1e8fce788eb31d9933065db8f8496d46403bf85eb0988b0b8ecfe12af04ac4f2fc44f9aa38fa5076fecd72cc7510cf5e9ea88  modemmanager-qt-5.113.0.tar.xz
"
